#include <bits/stdc++.h>
using namespace std;
using ll=long long;
vector<ll> arr1(2e5+5);//j+
vector<ll> arr2(2e5+5);//e-
int main()
{
  ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
  int n=0;cin>>n;
  for(int i=1;i<=n;++i)
  {
    int x;cin>>x;
    x=abs(x);
    if(i%2==1) arr1.push_back(x);
    else arr2.push_back(x);
  }
  ll ans=0;
  ll a=-1e9;//max
  ll b=1e9;//min
  //sort(arr.begin()+1,arr.begin()+1+n);
  for(int i=1;i<=n;++i)
  {
      a=max(a,arr2[i]);
      b=min(b,arr1[i]);
      ans=2*(a+b);
  }
  cout<<ans;
  return 0;
}
